import { registerAs } from '@nestjs/config';

export default registerAs('database', () => ({
  host: process.env.DB_HOST || 'localhost',
  port: parseInt(process.env.DB_PORT || '5432', 10) || 5432,
  username: process.env.DB_USER || 'postgres',
  password: process.env.DB_PASS || 'postgres',
  database: process.env.DB_NAME || 'rwa_platform',


  SUMSUB_APP_TOKEN: process.env.SUMSUB_APP_TOKEN || 'sbx:9u1JFMZtxylvButC7ubm7n6u.uj4AkviEJE351u4eDu',
  SUMSUB_SECRET_KEY: process.env.SUMSUB_SECRET_KEY || 'rw4sljpWYjl3wNajPjE68LTmP',
  SUMSUB_BASE_URL: process.env.SUMSUB_BASE_URL || 'https://api.sumsub.com',
  SUMSUB_LEVEL_NAME: process.env.SUMSUB_LEVEL_NAME || 'id-and-liveness',
}));

export const jwtConfig = registerAs('jwt', () => ({
  secret: process.env.JWT_SECRET || 'your-secret-key',
  expiresIn: process.env.JWT_EXPIRES_IN || '24h',
}));

export const appConfig = registerAs('app', () => ({
  port: parseInt(process.env.PORT || '3000', 10) || 3000,
  nodeEnv: process.env.NODE_ENV || 'development',
}));
